<script setup lang="ts">
import { onMounted } from 'vue'
import useStore from '@/stores'

const { homeStore } = useStore()
onMounted(() => {
    // 监听滚动事件
    window.addEventListener('scroll', homeStore.updateNavLinks)
})
</script>
<template>
    <div class="pf side-nav">
        <a href="javascript:;" :data-target="`#${item.id}`" class="pr nav-link" v-for="(item, index) in homeStore.sideNavList" :key="`nav${index}`" @click="homeStore.scrollToAnchor(item.id)">
            <img :src="item.img" alt="">
            <img :src="item.imgActive" alt="">
        </a>
    </div>
</template>
<style lang="scss" scoped>
@import '@/assets/styles/home_pc.scss';
</style>
